Remove the src/test.rs implicit test.
authorHuon Wilson <dbau.pp+github@gmail.com>
Sun, 13 Jul 2014 12:45:26 +0000 (22:45 +1000)
committerHuon Wilson <dbau.pp+github@gmail.com>
Sun, 13 Jul 2014 12:48:45 +0000 (22:48 +1000)
It's not unreasonable to have unittests in a separate submodule of the
crate (being called `test` or `tests`), and having them in their own
file can be very sensible. Thus, the `src/test.rs` implicit default is
likely to trip up some perfectly reasonable use-cases. There's already
the `tests/...` default, so repairing a codebase after this removal is
just moving `src/test.rs` to `tests/whatever_name_you_want.rs`.

Closes #187.

src/cargo/util/toml.rs
tests/test_cargo_test.rs

index 44b40595f7439bb37b55cd6accd1f8cb05639718..ffed1d2e0aae7f5d381761cfadbfcfa75a14ef88 100644 (file)
@@ -60,8 +60,6 @@ pub fn project_layout(root: &Path) -> Layout {
 
     try_add_files(&mut examples, root, "examples");
 
-    // support two styles of tests: src/test.rs or tests/*.rs
-    try_add_file(&mut tests, root, "src/test.rs");
     try_add_files(&mut tests, root, "tests");
 
     Layout {
index 85129fa1f31d0dfb1b01ebda10d7d319e28d2898..9dc1c91d343a62173abab70438ed6cbcd7f4c216 100644 (file)
@@ -194,7 +194,7 @@ test!(external_test_implicit {
             #[test]
             fn internal_test() {}
         "#)
-        .file("src/test.rs", r#"
+        .file("tests/external.rs", r#"
             extern crate foo;
 
             #[test]